Release 10.1A: OpenEdge Development:
.NET Open Clients


ProDataTable class

The Open Client toolkit provides the Progress.Open4GL.ProDataTable class to provide Progress extensions to the standard functionality available in the .NET DataTable class. It inherits from the ADO .NET System.Data.DataTable class. The Progress.Open4GL.ProDataTable class provides static methods that allow you to define Progress-specific mappings for the DataTable. This class also allows you to access the ErrorString runtime property.

Before-image methods

The syntax variations for the methods available on this class are given below.

The following method returns the current value of the BImageFlag (BEFORE-TABLE attribute) for the specified DataTable:

Syntax
static bool GetBImageFlag(System.Data.DataTable dt) 

The following method sets the current value of the BImageFlag for a specified DataTable. The BImageFlag must be set for dynamic temp-table and ProDataSet INPUT parameters to match the value of the BEFORE-TABLE attribute for the temp-table or temp-tables within the ProDataSet in the 4GL, as shown:

Syntax
static void SetBImageFlag(System.Data.DataTable dt, bool flag) 

Where flag is true or false.

Column-related methods

For methods in this section that set the data type of a DataTable column, proType must correspond to one of the valid Progress temp-table field data types found in the Progress.Open4GL.Parameter class, as shown in Table 4–7.

Table 4–7: Progress temp-table field data types
Progress temp-table field data type
Progress.Open4GL.Parameter
class constant
BLOB 
PRO_BLOB 
CHARACTER 
PRO_CHARACTER 
CLOB 
PRO_CLOB 
COM-HANDLE 
PRO_COMHANDLE  
DATE 
PRO_DATE 
DATETIME 
PRO_DATETIME 
DATETIME-TZ 
PRO_DATETIMETZ 
DECIMAL 
PRO_DECIMAL 
INTEGER 
PRO_INTEGER  
LOGICAL 
PRO_LOGICAL 
RAW 
PRO_RAW 
RECID 
PRO_RECID 
ROWID 
PRO_ROWID 
WIDGET-HANDLE  
PRO_WIDGETHANDLE 

The following method returns the integer value representing the Progress data type (see Table 4–7) for the specified column in the specified DataTable:

Syntax
static int GetColumnProType(System.Data.DataTable dt, string colName) 

Where colName is the name of the column in the DataTable.

The following methods set the Progress data type for the specified data column, where proType must correspond to one of the valid Progress-specific class constants found in the Progress.Open4GL.Parameter class (see Table 4–7):

Syntax
static void SetColumnProType(System.Data.DataTable dt, string colName, 
   int proType) 

Where colName is the name of the column in the DataTable.

Syntax
static void SetColumnProType(System.Data.DataColumn dc, int proType) 

Where dc is the DataColumn.

The following methods return the integer value representing the Progress data type (see Table 4–7) for the specified DataColumn:

Syntax
static int GetColumnProType(System.Data.DataTable dt, string colName) 

Where colName is the name of the column in the DataTable.

Syntax
static int GetColumnProType(System.Data.DataColumn dc) 

Where dc is the DataColumn.

The following method returns true if the specified column in the specified DataTable is part of a temp-table array field:

Syntax
static bool IsExtentColumn(System.Data.DataTable dt, string colName) 

Where colName is the name of the column in the DataTable.

The following method identifies a set of columns that are the flattened representation of a temp-table array field for the specified DataTable:

Syntax
static void SetExtentColumns(System.Data.DataTable dt, string proFieldName, 
string startColName, int extent) 

Where:

For example, a DataTable with the columns Name, Phone, Month1, Month2, Month3, Month4, Month5, Month6, Month7, Month8, Month9, Month10, Month11, and Month12 that mapped to a temp-table with three columns, Name, Phone, and Month with extent 12, would need to have a call to this method as follows:

ProdataTable.SetExtentColumns(myDataTbl, "Month", "Month1", 12) 

The following method returns the 0-based display position of the specified DataColumn within its DataTable:

Syntax
static int GetUserOrder(System.Data.DataColumn dc) 

The following method sets the 0-based display position of the specified DataColumn:

Syntax
static void SetUserOrder(System.Data.DataColumn, int userOrder) 

Error handling methods

The following method returns any error string associated with the specified DataTable returned from Progress. You can use the following method on an INPUT-OUTPUT or OUTPUT parameter to determine any error returned by the remote 4GL method:

Syntax
string GetErrorString(System.Data.DataTable dt) 

The following method sets the error string associated with the specified DataTable. You can use the following method to relay an error to the remote 4GL method on an INPUT or INPUT-OUTPUT parameter:

Syntax
void SetErrorString(System.Data.DataTable dt, string newValue) 

Where newValue is the error string value.

Array methods

The following methods return the array field name with which the specified DataColumn is associated. If it is not part of an array, it returns null:

Syntax
static string GetArrayFieldName(System.Data.DataTable dt, string colName) 

Syntax
static string GetArrayFieldName(System.Data.DataColumn dc) 

The array field name for a DataColumn is set when ProDataTable.SetExtentColumns() is called.

Schema marshaling methods

The following method allows the specified DataTable to be marshaled from the .NET client to the AppServer without schema information, when flag is set to true:

Syntax
void SetNoSchemaMarshal(System.Data.DataTable dt, bool flag) 

Using this method suppresses index descriptions and all field information and aids in faster transmission of data, thereby increasing the performance of your application.

You can use this method when the receiving side knows the schema definition for the table and validation is not necessary.

The corresponding Progress temp-table on the AppServer must have the same schema as the DataTable on the client. You can use the SetNoSchemaMarshal method with a strongly typed DataTable parameter or a DataTable within a strongly typed DataSet parameter. If set to true, when the DataTable is sent to the AppServer, Progress generates a Progress.Open4GL.Exceptions.RunTime4GLErrorException if the Progress temp-table’s schema does not match the incoming data from the .NET client.

The following method returns true if the DataTable parameter is not marshaled with schema information to the AppServer; it returns false if schema information is marshaled:

Syntax
boolean GetNoSchemaMarshal(System.Data.DataTable dt) 


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095